from django.db import models

# Create your models here.
class Draw(models.Model):

    creation_date = models.DateTimeField(auto_now_add=True)
    subject = models.CharField(max_length=50)
    body = models.TextField(max_length=400)
    language = models.CharField(max_length=6)
    code = models.CharField(max_length=12)
    
class Player(models.Model):
    
    name = models.CharField(max_length=50)
    friend = models.ForeignKey('self',null=True)
    draw = models.ForeignKey(Draw)
    
    email = models.EmailField()
    domain = models.CharField(max_length=50)
    
    pwd = models.CharField(max_length=10)
    wish = models.TextField(max_length=200, null=True, blank=True)
    dont_wish = models.TextField(max_length=200, null=True, blank=True)
    got = models.TextField(max_length=200, null=True, blank=True)
    
    def __unicode__(self):
        return '%s ' % self.name
